package br.eng.eliseu.gwt.gestaoWeb.client.ui.site.main;

import br.eng.eliseu.gwt.gestaoWeb.client.mvp.PortalResource;
import br.eng.eliseu.gwt.gestaoWeb.client.mvp.PresenterMenuEnum;
import br.eng.eliseu.gwt.gestaoWeb.client.mvp.presenter.BasePresenter;
import br.eng.eliseu.gwt.gestaoWeb.client.mvp.view.BaseDisplay;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasClickHandlers;

public class HomePresenter extends BasePresenter{

	
	public interface Display extends BaseDisplay {
		public HasClickHandlers getCadastroButton();
	}

	private final PortalResource recursos;
	private final Display display;

	public HomePresenter(Display display, PortalResource recursos) {
		this.recursos = recursos;
		this.display = display;
		bind();
	}


	public void bind() {
		// --- Evendo do click do botao Cadastro
	    getDisplay().getCadastroButton().addClickHandler(new ClickHandler() {   
	        public void onClick(ClickEvent event) {
	        	getRecursos().getPlaceManager().newPlace(PresenterMenuEnum.CADASTROGRATIS);
	        }
	      });
	}
	
	public void go() {
		// TODO Auto-generated method stub
	}

	public PortalResource getRecursos() {
		return recursos;
	}
	public Display getDisplay() {
		return display;
	}

}
